<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of IndexController
 *
 * @author Naoufal
 */
class Admin_IndexController extends Zend_Controller_Action {

    // action to handle admin URLs
    public function preDispatch() {
        // set admin layout
        // check if user is authenticated
        // if not, redirect to login page
        $url = $this->getRequest()->getRequestUri();
        $this->_helper->layout->setLayout('admin');
        if (!Zend_Auth::getInstance ()->hasIdentity()) {
            $session = new Zend_Session_Namespace('app.auth');
            $session->requestURL = $url;
            $this->_redirect('/login');
        }
    }

    public function indexAction() {
        
    }

}

?>
